package com.dlc.beijingrfid.adapter;

import com.dlc.commonlibrary.adapter.BaseRecyclerAdapter;
import com.dlc.beijingrfid.R;
import com.dlc.beijingrfid.base.Constants;
import com.dlc.beijingrfid.net.bean.WashOrderBean;

/**
 * Created by John on 2017/7/19.
 */

public class WashOrderAdapter<T extends WashOrderBean.DataBean.ListBean> extends BaseRecyclerAdapter<T> {

    int type;
    public WashOrderAdapter(int type){
        this.type = type;
    }
    @Override
    public int getItemLayoutId(int viewType) {
        return R.layout.item_wash_order;
    }

    @Override
    public void onBindViewHolder(CommonHolder holder, int position) {
        T item = getItem(position);

        if(type == Constants.START_TYPE.WASH_ORDER){
            holder.setText(R.id.tv_number,"送洗单号："+ item.getOrderno());
            holder.setText(R.id.tv_company,"送洗公司名称："+ item.getCompany());
            holder.setText(R.id.tv_time,"送洗时间："+item.getCtime());
        }else{
            holder.setText(R.id.tv_number,"租赁单号："+ item.getOrderno());
            holder.setText(R.id.tv_company,"公司名称："+ item.getCompany());
            holder.setText(R.id.tv_time,"租赁物品时间："+item.getCtime());
        }

    }
}
